package org.gjy.m8.stream;

import com.google.common.collect.Lists;
import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-08-04 14:41:31
 */
@Data
public class Domain {

    private Integer id;
    private String name;
    private String gender;
    private Integer age;
    private BigDecimal price;

    public static List<Domain> list() {
        ArrayList<Domain> domains = Lists.newArrayList();
        for (int i = 1; i <= 100; i++) {
            Domain domain = new Domain();
            domain.setId(i);
            domain.setName("A" + i);
            domain.setGender(i % 2 == 0 ? "男" : "女");
            domain.setAge((ThreadLocalRandom.current().nextInt(5) + 1) * 10);
            domain.setPrice(BigDecimal.valueOf(ThreadLocalRandom.current().nextLong(100)));
            domains.add(domain);
        }
        return domains;
    }
}
